package main

import "fmt"

/**
interface{}	空接口，传空接口能接收所有的类型
*/

func main() {
	allChan := make(chan interface{}, 10)
	allChan <- dog{Name: "小黄", Color: "Yellow"}
	allChan <- 1
	allChan <- "很2"
	fmt.Printf("%v %v %v\n", <-allChan, <-allChan, <-allChan)

	dog1 := <-allChan
	fmt.Printf("%T\n", dog1)

	a := dog1.(dog) // 需要 类型断言，才能取出对象属性
	//	a := (<-allChan).(dog)
	fmt.Printf(a.Color)

}

type dog struct {
	Name  string
	Color string
}
